let mysql = require('mysql');

let connection = mysql.createPool({
  host: 'localhost',
  port: 3306,
  user: 'root',
  password: 'rootroot',
  database: 'pachong'

});

module.exports = function (sql) {
  return new Promise((resolve, reject) => {
    connection.query(sql, (err, res) => {
      if (err) {
        reject(err);
      }else {
        resolve(res);
      }
    })
  });
};
